﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class ChiTietPhieuNhapKho
    {
        public int MaCTPNK { get; set; }
        public string MaCTPNKHienThi
        {
            get
            {
                return "CTPNK" + MaCTPNK;
            }
        }
        public int MaPNK { get; set; }
        public int MaHang { get; set; }
        public string MaHangHienThi
        {
            get
            {
                return "HH" + MaHang;
            }
        }
        public string TenHang { get; set; }
        public int SoLuong { get; set; }
        public double DonGiaNhap { get; set; }
        public DateTime HanSuDung { get; set; }

        public ChiTietPhieuNhapKho(int maPNK, int maHang,
            string tenHang, int soLuong, double donGiaNhap)
        {
            this.MaCTPNK= 0;
            this.MaPNK = maPNK;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaNhap = donGiaNhap;
            this.HanSuDung = DateTime.Today;
        }

        public ChiTietPhieuNhapKho(int maCTPNK, int maPNK, int maHang,
            string tenHang, int soLuong, double giaNhap, DateTime hanSuDung)
        {
            this.MaCTPNK = maCTPNK;
            this.MaPNK = maPNK;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaNhap = giaNhap;
            this.HanSuDung = hanSuDung;
        }

        public void CapNhat(int maHang,
            string tenHang, int soLuong, double giaNhap, DateTime hanSuDung)
        {
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaNhap = giaNhap;
            this.HanSuDung=hanSuDung;
        }
    }
}
